package com.example.learndevice

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.example.learndevice.databinding.ActivityMainBinding
import com.example.learndevice.ui.*
import com.example.mydefinedview1.base.BaseActivity

class MainActivity : BaseActivity<ActivityMainBinding>(),View.OnClickListener {

    override fun ActivityMainBinding.initBinding() {
        btnTurnView.setOnClickListener(this@MainActivity)
        btnTurnSurface.setOnClickListener(this@MainActivity)
        btnCameraInfo.setOnClickListener(this@MainActivity)
        btnPhotograph.setOnClickListener(this@MainActivity)
        btnTurnTexture.setOnClickListener(this@MainActivity)
        btnShooting.setOnClickListener(this@MainActivity)
        btnSeekbar.setOnClickListener(this@MainActivity)
        btnVolume.setOnClickListener(this@MainActivity)
        btnAudio.setOnClickListener(this@MainActivity)
        btnVideo.setOnClickListener(this@MainActivity)
        btnSensor.setOnClickListener(this@MainActivity)
        btnAcceleration.setOnClickListener(this@MainActivity)
        btnLight.setOnClickListener(this@MainActivity)
        btnDirection.setOnClickListener(this@MainActivity)
        btnStep.setOnClickListener(this@MainActivity)
        btnFlash.setOnClickListener(this@MainActivity)
        btnLocationSetting.setOnClickListener(this@MainActivity)
        btnLocationBegin.setOnClickListener(this@MainActivity)
        btnWechat.setOnClickListener(this@MainActivity)
    }

    override fun onClick(v: View?) {
        when(v?.id){
            mBinding.btnTurnView.id -> startActivity(Intent(this,TurnViewActivity::class.java))
            mBinding.btnTurnSurface.id -> startActivity(Intent(this,TurnSurfaceActivity::class.java))
            mBinding.btnCameraInfo.id -> startActivity(Intent(this,CamaraInfoActivity::class.java))
            mBinding.btnPhotograph.id -> startActivity(Intent(this,PhotographActivity::class.java))
            mBinding.btnTurnTexture.id -> startActivity(Intent(this,TurnTextureActivity::class.java))
            mBinding.btnShooting.id -> startActivity(Intent(this,ShootingActivity2::class.java))
            mBinding.btnSeekbar.id -> startActivity(Intent(this,SeekbarActivity::class.java))
            mBinding.btnVolume.id -> startActivity(Intent(this,VolumeActivity::class.java))
            mBinding.btnAudio.id -> startActivity(Intent(this,AudioActivity::class.java))
            mBinding.btnVideo.id -> startActivity(Intent(this,VideoActivity::class.java))
            mBinding.btnSensor.id -> startActivity(Intent(this,SensorActivity::class.java))
            mBinding.btnAcceleration.id -> startActivity(Intent(this,AccelerationActivity::class.java))
            mBinding.btnLight.id -> startActivity(Intent(this,LightActivity::class.java))
            mBinding.btnDirection.id -> startActivity(Intent(this,DirectionActivity::class.java))
            mBinding.btnStep.id -> startActivity(Intent(this,StepActivity::class.java))
            mBinding.btnFlash.id -> startActivity(Intent(this,FlashActivity::class.java))
            mBinding.btnLocationSetting.id -> startActivity(Intent(this,LocationSettingActivity::class.java))
            mBinding.btnLocationBegin.id -> startActivity(Intent(this,LocationBeginActivity::class.java))
            mBinding.btnWechat.id -> startActivity(Intent(this,WechatActivity::class.java))
        }
    }

}